/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.market.web.EJB;

import com.market.web.model.Inventory;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.ws.rs.GET;

/**
 *
 * @author ps
 */
@Stateless
public class InventoryFacade extends AbstractFacade<Inventory> {
    @PersistenceContext(unitName = "onlineMarketPU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public InventoryFacade() {
        super(Inventory.class);
    }
    
    @GET
    public List<Inventory> RetrieveInventory(){
        return em.createNamedQuery("Inventory.findAll", Inventory.class).getResultList();
    }
    
}
